/**
*   \file   Line3.h
*   \author Dave Reid
*   \brief  Header file for the 3D line class.
*/
#ifndef __EAGL_line3_H_
#define __EAGL_line3_H_

#include "Point3.h"

namespace eagl
{

/**
*   \brief  Class representing a line in 3D space.
*
*   A line is made up of two points - a start point and an end point. It is assumed
*   that the line is pointing in the direction of the start point towards the end point.
*/
class Line3
{
public:

    /**
    *   \brief  Default constructor.
    */
    Line3() : m_start(0.0f, 0.0f, 0.0f), m_end(1.0f, 0.0f, 0.0f)
    {
    }

    /**
    *   \brief  Copy constructor.
    */
    Line3(const Line3 &line) : m_start(line.getStartPoint()), m_end(line.getEndPoint())
    {
    }

    /**
    *   \brief  Constructor.
    */
    Line3(const Point3 &start, const Point3 &end) : m_start(start), m_end(end)
    {
    }


    /**
    *   \brief  Retrieves the start point of the line.
    *   \return The start point of the line.
    */
    const Point3 & getStartPoint() const
    {
        return this->m_start;
    }

    /**
    *   \brief  Retrieves the end point of the line.
    *   \return The end point of the line.
    */
    const Point3 & getEndPoint() const
    {
        return this->m_end;
    }

    /**
    *   \brief  Sets the start point of the line.
    *   \param  start [in] The new start point of the line.
    */
    void setStartPoint(const Point3 &start)
    {
        this->m_start = start;
    }

    /**
    *   \brief  Sets the end point of the line.
    *   \param  end [in] The new end point of the line.
    */
    void setEndPoint(const Point3 &end)
    {
        this->m_end = end;
    }

private:

    /// The start point.
    Point3 m_start;

    /// The end point.
    Point3 m_end;

};

}

#endif  // __EAGL_line3_H_